const mongoose=require('mongoose');

const commentSchema=new mongoose.Schema({
    // 文章ID
    aid:{
        type:mongoose.Schema.Types.ObjectId,
        ref:'article'
    },
    // 评论用户ID
    uid:{
        type:mongoose.Schema.Types.ObjectId,
        ref:'user'
    },
    time:{
        type:Date,
    },
    content:{
        type:String
    }
});

const comment=mongoose.model('comment',commentSchema);

module.exports={
    comment
}

